package com.xintonghua.bussiness.ui.fragment;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.uuzuche.lib_zxing.activity.CodeUtils;
import com.xintonghua.base.ui.BaseActivity;
import com.xintonghua.base.utils.MyTimeUtils;
import com.xintonghua.bussiness.R;
import com.xintonghua.bussiness.api.manager.AuthManager;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 作者：wanxianyi
 * 时间：2018/1/15.
 * 包名：com.xintonghua.bussiness.ui.fragment
 */

public class QrCodeActiivity extends BaseActivity {
    @BindView(R.id.iv_qr_code)
    ImageView ivQrCode;
    @BindView(R.id.tv_close)
    TextView tvClose;
    Bitmap mBitmap;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_qr_code);
        ButterKnife.bind(this);
        mBitmap = CodeUtils.createImage("hongyi,daka," + MyTimeUtils.getYYMMDDX(System.currentTimeMillis()) + "," + AuthManager.geteAuth().getShop_id(), 200, 200, null);
        ivQrCode.setImageBitmap(mBitmap);
    }

    @OnClick(R.id.tv_close)
    public void onViewClicked() {
        finish();
    }

}
